<!-- Used by audio_playback_perf to verify audio recorded. -->
<!DOCTYPE html>
<html lang="en-US">
  <head>
    <title>Playback Test</title>
  </head>
  <body>
    <audio autoplay preload controls></audio>
  </body>
  <script type="text/javascript">
    var error = '';
    function startTest(src) {
      var audio = document.querySelector('audio');
      audio.addEventListener('ended', function(evt) {
        end(true);
      }, false);
      audio.addEventListener('error', function(evt) {
        error = 'Error playing audio, code ' + evt.target.error.code;
        end(false);
      }, false);
      // High volume can produce sound noise on some audio devices.  This value
      // may not be significant if audio device volume is controlled externally.
      audio.volume = 0.9;
      audio.src = src;
    }

    function end(status) {
      window.domAutomationController.send(status);
    }
  </script>
</html>
